package com.zr.vo;

import com.zr.utils.HttpUtil;
import com.zr.vo.sys.SysUser;

import java.io.Serializable;
import java.util.Date;

public class LoginUser implements Serializable {

    private String userId;          //用户id

    private String userName;        //用户姓名

    private Date time;              //登录时间

    private String type;

    private String ip;

    private String browserType;

    private String osType;


    public LoginUser() {
    }

    public LoginUser(SysUser sysUser) {
        this.userId = sysUser.getUserId();
        this.userName = sysUser.getUserName();
        this.time = new Date();
        this.type = "登录";
        this.ip = HttpUtil.ip();
        this.browserType = HttpUtil.userAgent().getBrowser().toString();
        this.osType = HttpUtil.userAgent().getOperatingSystem().toString();

    }


    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getBrowserType() {
        return browserType;
    }

    public void setBrowserType(String browserType) {
        this.browserType = browserType;
    }

    public String getOsType() {
        return osType;
    }

    public void setOsType(String osType) {
        this.osType = osType;
    }


}
